<?xml version="1.0" encoding="utf-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">


	<h:form>
		<p:panel id="panel" header="Cadastrar servidor">

			<h:panelGrid columns="3" cellpadding="5">
				<p:outputLabel for="nome" value="Nome: " />
				<p:inputText id="nome"
					value="#{servidorBean.servidor.nomePessoa}" required="true"
					label="nome">
					<f:validateLength minimum="5" maximum="90" />
				</p:inputText>
				<p:message for="nome" />

				<p:outputLabel for="cpf" value="CPF:" />
				<p:inputMask id="cpf" value="#{servidorBean.servidor.cpf}"
					mask="999.999.999-99" required="true" label="cpf" />
				<p:message for="cpf" />

				<p:outputLabel for="matricula" value="Matrícula: " />
				<p:inputText id="matricula"
					value="#{servidorBean.servidor.matricula}" required="true"
					label="matricula">
					<f:validateLength minimum="11" maximum="11" />
				</p:inputText>
				<p:message for="matricula" />

				<p:outputLabel for="endereco" value="Endereço: " />
				<p:inputText id="endereco"
					value="#{servidorBean.servidor.endereco}" required="true"
					label="endereco">
					<f:validateLength minimum="5" maximum="255" />
				</p:inputText>
				<p:message for="endereco" />

				<p:outputLabel for="cep" value="CEP: " />
				<p:inputMask id="cep" value="#{servidorBean.servidor.cep}"
					mask="99.999-999" required="true" label="cep" />
				<p:message for="cep" />

				<p:outputLabel for="telefone" value="Telefone: " />
				<p:inputMask id="telefone"
					value="#{servidorBean.servidor.telefone}" mask="(99) 9999-9999"
					required="true" label="telefone" />
				<p:message for="telefone" />

				<p:outputLabel for="email" value="E-mail: " />
				<p:inputText id="email" value="#{servidorBean.servidor.email}"
					required="true" label="email">
					<f:validateLength minimum="2" />
				</p:inputText>
				<p:message for="email" />

				<p:outputLabel for="titulacao" value="Titulação: " />
				<p:inputText id="titulacao"
					value="#{servidorBean.servidor.titulacao}" required="true"
					label="titulacao">
					<f:validateLength minimum="2" maximum="45" />
				</p:inputText>
				<p:message for="titulacao" />
				
				<h:outputLabel for="cargo" value="Cargo: " />
				<h:selectOneMenu id="cargo"
					value="#{servidorBean.servidor.cargoServidor.idCargoServidor}"
					required="true" label="cargo">
					<f:selectItems value="#{servidorBean.cargos}" />
				</h:selectOneMenu>
				<p:message for="cargo" />

				<p:outputLabel for="localtrabalho" value="Local de trabalho: " />
				<p:inputText id="localtrabalho"
					value="#{servidorBean.servidor.local}" required="true"
					label="localtrabalho">
					<f:validateLength minimum="5" maximum="45" />
				</p:inputText>
				<p:message for="localtrabalho" />

				<h:outputLabel for="banco" value="Instituicão Bancaria: *" />
				<h:selectOneMenu id="banco"
					value="#{servidorBean.servidor.dadosBancarios.instituicaoBancaria.idInstituicaoBancaria}"
					required="true" label="banco">
					<f:selectItems value="#{servidorBean.instituicoesBancarias}" />
				</h:selectOneMenu>
				<p:message for="banco" />

				<p:outputLabel for="operacao" value="Operação: " />
				<p:inputText id="operacao"
					value="#{servidorBean.servidor.dadosBancarios.operacao}"
					required="true" label="operacao">
					<f:validateLength minimum="3" maximum="3" />
				</p:inputText>
				<p:message for="operacao" />

				<p:outputLabel for="conta" value="Conta: " />
				<p:inputText id="conta"
					value="#{servidorBean.servidor.dadosBancarios.conta}"
					required="true" label="conta">
					<f:validateLength minimum="15" maximum="15" />
				</p:inputText>
				<p:message for="conta" />

				<h:outputLabel for="senha1" value="Senha: *" />
				<p:password id="senha1" value="#{servidorBean.servidor.senha}"
					match="senha2" label="senha1" required="true" />
				<p:message for="senha1" />

				<h:outputLabel for="senha2" value="Digite a senha novamente: *" />
				<p:password id="senha2" value="#{servidorBean.servidor.senha}"
					label="senha2" required="true" />
				<p:message for="senha2" />

			</h:panelGrid>

			<p:commandButton value="Finalizar Cadastro" update="panel"
				actionListener="#{servidorBean.save}" icon="ui-icon-check"
				action="cadastroConcluido" />
		</p:panel>
	</h:form>

</ui:composition>